<?php
/*
	插件概览
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$this->model('model')->checkjuese(6);
$juese_id=6;
$workerids=$this->model('model')->getworkerids($juese_id);
if($_RQ['op']=='get'){
	pdo_update('jy_yxw_member',array('oldworker6id'=>$_SESSION['workerid']),array('oldworker6id'=>0,'worker6id'=>$_SESSION['workerid'],'uniacid'=>$_SESSION['uniacid']));
	//显示统计数据
	$daytime = mktime(0,0,0,date('m'),date('d'),date('Y'));
	$member['all'] = pdo_count('jy_yxw_member',array('worker'.$juese_id.'id'=>$workerids,'status'=>32,'huifang_time >'=>100,'storeid'=>$_SESSION['storeid'],'uniacid'=>$_SESSION['uniacid']));
	$member['day'] = pdo_count('jy_yxw_member',array('worker'.$juese_id.'id'=>$workerids,'status'=>32,'huifang_time between'=>array(100,$daytime),'storeid'=>$_SESSION['storeid'],'uniacid'=>$_SESSION['uniacid']));
	$isbao['all'] = pdo_count('jy_yxw_infee_log',array('worker'.$juese_id.'id'=>$workerids,'storeid'=>$_SESSION['storeid'],'type'=>1,'status'=>1,'uniacid'=>$_SESSION['uniacid']));
	$isbao['allday'] = pdo_count('jy_yxw_infee_log',array('worker'.$juese_id.'id'=>$workerids,'storeid'=>$_SESSION['storeid'],'type'=>1,'status'=>1,'uniacid'=>$_SESSION['uniacid'],'jiao_time >'=>$daytime));
	$isbao['ding'] = pdo_count('jy_yxw_infee_log',array('worker'.$juese_id.'id'=>$workerids,'storeid'=>$_SESSION['storeid'],'type'=>2,'status'=>1,'uniacid'=>$_SESSION['uniacid']));
	$isbao['dingday'] = pdo_count('jy_yxw_infee_log',array('worker'.$juese_id.'id'=>$workerids,'storeid'=>$_SESSION['storeid'],'type'=>2,'status'=>1,'uniacid'=>$_SESSION['uniacid'],'jiao_time >'=>$daytime));
	$isbao['tui'] = pdo_count('jy_yxw_tuifee_log',array('workerheid'=>$workerids,'storeid'=>$_SESSION['storeid'],'type'=>array(0,1),'status'=>4,'uniacid'=>$_SESSION['uniacid']));
	$isbao['tuiday'] = pdo_count('jy_yxw_tuifee_log',array('workerheid'=>$workerids,'storeid'=>$_SESSION['storeid'],'type'=>array(0,1),'status'=>4,'uniacid'=>$_SESSION['uniacid'],'tuidaytime >'=>$daytime));
	$htmls=array(
		array('type'=>'data','num'=>12,'one_num'=>3,'title'=>'今日/总数据','datas'=>array(
			array('title'=>'交定金用户','num'=>2,'data'=>array($isbao['allday'],$isbao['all'])),
			array('title'=>'成交用户','num'=>2,'data'=>array($isbao['dingday'],$isbao['ding'])),
			array('title'=>'退成交用户','num'=>2,'data'=>array($isbao['tuiday'],$isbao['tui'])),
			array('title'=>'待回访客户','num'=>2,'data'=>array($member['day'],$member['all'])),
		)),
	);
	$return['htmls']=$htmls;
	exi($return);
}